<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>mamma</title>
<link rel="shortcut icon" href="../image/icon_mamma.ico">
<script src="../js/jquery-2.1.1.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> 
<script type ="text/javascript" src ="../js/jquery.columns-1.0.min.js"></script>
<link id="style" href="../css/clean.css" rel="stylesheet" media="screen">

<script type="text/javascript">

$(document).ready(function() {
	
/* 	$.ajax({
		url : 'gjList.action',
		type : 'POST',
		dataType : 'json', 	
		success:output
	}); */
	 
	listDiv1();
	
	 $('#write').on('click',gowrite); 
	
	 $('#main').on('click',gomain); 
});

function listDiv1(){
	
	$.ajax({
		url : 'gjList.action',
		type : 'POST',
		dataType : 'json', 	
		success:function(json) { 
			jlist = $('#listDiv1').columns({
				data:json.jlist,
				schema: [
					{"header":"번호", "key":"id"},
					{"header":"제목", "key":"title" , "template":'<a href="<s:url value="jread.action?id="/>{{id}}">{{title}}</a>'}
				]

			}); 
		}
	}); 
	
}



/* 
function output(msg){
	
		
		$('#listDiv1').html('');
		
		var get = '<table border="1" style="text-align: center;">';
		 get += '<tr>';
		 get += '<td width="100"> 넘버 </td>';
		 get += '<td width="200"> 제목 </td>'; 
		 get += '</tr>';
		  $.each(msg.jlist, function(key, item){
			 get += '<tr>';
			 get += '<td class="tdId">' + item.id + '</td>'
			 get += '<td class="tdTitle" data-num="'+ item.id +'"><a href="javascript:jread('+ item.id +')">' + item.title + '</a></td>'; //제목
			 get += '</tr>';
	    }); 
		 get += '</table>';
		
		 $('#listDiv1').html(get);
				
	} */
	
 function gowrite(){
	location.href="../admin/goJusaPage.action";
 }
/* 
 function jread(id){
	
	location.href="jread.action?id=" + id;
}   */
 
 function gomain(){
		location.href='../admin/goAdminPage.action';
	}

</script>

</head>
<body topmargin="0"  leftmargin="0" rightmargin="0">
<table id="adhead" border="0" width="100%" height="100px" style="text-align: center;background-color: #EAEAEA;">
<tr>
<td>	
	<a href="../admin/goNoticelistPage.action">공지 관리</a>
	<a href="../admin/goJusalistPage.action">백신 알림</a>
	<a href="../admin/goMemberlistPage.action">회원 목록 보기</a>
	<a href="../admin/goAdBannerPage.action">광고 관리</a>
	<a href="../account/logout.action">로그아웃</a>
</td>
</tr></table>
<h1 style="text-align: center;">[공지]</h1> 

<div id="listDiv1" style="margin:0 auto; width: 900px;">
</div>

<form style="text-align: center;" >
<input type="button" id="write" value="백신입력"> <input type="button" id="main" value="메인으로">
</form>
</body>
</html>